<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card">
    <div class="layui-card-body padding-left-40">

        <fieldset class="layui-form-item">
            <legend>用户资料</legend>
            <div class="layui-row layui-col-space15">
                <div class="layui-col-xs3">
                    <div class="layui-table">
                        <div class="headimg WechatUserHead" data-lazy-src="{$user.headimg|default='__ROOT__/static/theme/img/headimg.png'}" data-tips-image></div>
                    </div>
                </div>
                <div class="layui-col-xs9">
                    <label class="layui-form-item relative block">
                        <span class="help-label"><b>微信昵称</b>Wechat Nickname</span>
                        <input class="layui-input layui-bg-gray" data-bind="nickname" placeholder="请使用微信扫码登录" readonly value="{$user.nickname|default=''}">
                    </label>
                    <label class="relative block">
                        <span class="help-label"><b>微信标识</b>Wechat Openid</span>
                        <input class="layui-input layui-bg-gray" data-bind="openid" placeholder="请使用微信扫码登录" readonly value="{$user['openid1']?:$user['openid2']}">
                    </label>
                </div>
            </div>
        </fieldset>

        <label class="layui-form-item layui-hide">
            <span class="help-label"><b>充值单号</b>Code</span>
            <input class="layui-input layui-bg-gray" name="code" placeholder="请输入充值单号" readonly required value="{$vo.code|default=''}">
        </label>

        <label class="layui-form-item layui-hide">
            <span class="help-label"><b>余额充值名称</b>Name</span>
            <input class="layui-input" maxlength="100" name="name" placeholder="请输入余额充值名称" required value="{$vo.name|default='后台余额充值'}">
        </label>

        <label class="layui-form-item relative block">
            <span class="help-label"><b>充值账户余额</b>Amount</span>
            <input class="layui-input" data-blur-number="2" data-value-max="999999999.99" maxlength="12" name="amount" placeholder="请输入充值账户余额" required value="{$vo.amount|default='0.00'}">
            <span class="help-block">请输入要充值的金额，充值后可以使用此余额购买商品</span>
        </label>

        <div class="layui-form-item label-required-prev">
            <span class="help-label"><b>升级用户等级</b>Upgrade</span>
            <select class="layui-select" name="upgrade" lay-filter="upgrade">
                <option value="0">-- 不升级 --</option>
                {foreach $upgrades as $upgrade}{if isset($vo.upgrade) and $vo.upgrade eq $upgrade.number}
                <option selected value="{$upgrade.number|default=0}">升级到 [ VIP{$upgrade.number|default='0'} ] {$upgrade.name|default=''}</option>
                {else}
                <option value="{$upgrade.number|default=0}">升级到 [ VIP{$upgrade.number|default='0'} ] {$upgrade.name|default=''}</option>
                {/if}{/foreach}
            </select>
            <span class="help-block">请选择目标升级等级，当用户低于当前等级时会进行用户升级操作</span>
        </div>

        <div class="layui-form-item relative block">
            <span class="help-label"><b>余额充值备注</b>Remark</span>
            <label class="relative block">
                <textarea class="layui-textarea" name="remark" placeholder="请输入余额充值备注">{$vo.remark|default=''}</textarea>
            </label>
        </div>

    </div>

    <div class="hr-line-dashed"></div>
    <input name='uuid' type='hidden' value='{$vo.uuid|default=$user.id}'>
    {notempty name='vo.id'}<input name='id' type='hidden' value='{$vo.id}'>{/notempty}

    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" data-close data-confirm="确定要取消编辑吗？" type='button'>取消编辑</button>
    </div>
</form>

<style>
    .WechatUserHead {
        width: 138px !important;
        height: 138px !important;
    }
</style>